/**
 * 员工端相关API
 */

import {
	http,
	Method
} from "@/utils/request.js";


/**
 * 接单大厅认领任务
 * @param orderSn 订单sn
 * @param clerkId 员工id
 */
export function updateClaim(params) {
	return http.request({
		url: `/order/order/${params.orderSn}/claim`,
		method: Method.POST,
		needToken: true,
		params
	});
}

/**
 * 接单大厅列表数据
 * @param clerkId 员工ID
 * @param notConvert 	需要驼峰转换蛇形
 * @param order 	排序方式 asc/desc
 * @param pageNumber
 * @param pageSize
 * @param sort 店铺ID
 * @param storeId 店铺ID
 * @param tag 页面标签,示例值(DATING:全部,MY_ALL:我的全部任务,MY_DELIVERED:配货,MY_ENTRUCKED:装车,MY_COMPLETE:已完成)
 */
export function getClaimList(params) {
	return http.request({
		url: `/order/order/clerk/list`,
		method: Method.GET,
		needToken: true,
		params
	});
}

/**
 * 订单配货
 * @param orderSn 订单sn
 * @param params {pics , remark}
 */
export function orderDelivery(orderSn, data) {
	return http.request({
		url: `/order/order/${orderSn}/delivery`,
		method: Method.POST,
		needToken: true,
		header: {
			"Content-Type": "application/x-www-form-urlencoded",
		},
		data,
	});
}

/**
 * 订单装车
 * @param orderSn 订单sn
 * @param params {pics , remark}
 */
export function orderEntruck(orderSn, data) {
	return http.request({
		url: `/order/order/${orderSn}/entruck`,
		method: Method.POST,
		needToken: true,
		header: {
			"Content-Type": "application/x-www-form-urlencoded",
		},
		data
	});
}